
import { defineStore } from "pinia";
import { ref, watch } from "vue";

export const useCounterStore = defineStore('counter', () =>{
  //state写法，定义数据
  const count=ref(10)
  //action写法，定义修改数据的方法（action，同步+异步）
  const increament=()=>{count.value++}
  //getters写法
  const double=()=>{return count.value*2}
  return{count,increament,double}
});